package com.attendance.chdingtask.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 设备名称
 */

@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Data
@Table(name="md_device")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModel(description = "员工表")
@EntityListeners(AuditingEntityListener.class)
public class MdDevice implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @ApiModelProperty(value = "主键")
    private  Long id;
    /**
     * 魔点设备SN码
     */
    @ApiModelProperty(value = "魔点设备SN码")
    private String deviceSn;

    /**
     * 魔点设备名称
     */
    @ApiModelProperty(value = "魔点设备名称")
    private  String deviceName;

    /**
     * 门禁简称
     */
    @ApiModelProperty(value = "门禁简称")
    private  String shortName;

    /**
     * 进出入标识符：J-表示进；C-表示出
     */
    @ApiModelProperty(value = "进出入标识符：J-表示进；C-表示出")
    private String flag;

    /**
     *  区域 id：  设备序号；
     */
    @ApiModelProperty(value = "排序")
    private Long orderNo;


    /**
     *  区域id；
     */
    @ApiModelProperty(value = "地点id")
    private Long areaId;

    /**
     *  区域名称 ：  生产区-0；生活区-1；维护基地-2；
     */
    @ApiModelProperty(value = "区域名称")
    private String areaName;



    /**
     * 删除标志
     */
    private Integer dr = Integer.valueOf(0);

    private String corpId;


    /**
     * 子类
     */
    @Transient
    private Integer countNum ;


    @CreatedDate
    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @LastModifiedDate
    @Column(name = "modify_time")
    @ApiModelProperty(value = "修改时间")
    private Date modifyTime;
}
